<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    function strIgnoreCase(needStr,str) {
        let regEx = RegExp("^"+needStr+"$","i");
        return regEx.test(str);
    }

    strIgnoreCase("aBcd","ABCd");
</script>
</body>
</html>